﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace HelloMinasan.Web.Song.ViewModels
{
    public class ChangePasswordModel
    {
        public ChangePasswordModel()
        {
            ReturnUrl = "/Members/LogOn";
        }

        [Required(ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "OldPasswordEmpty")]
        [DataType(DataType.Password)]
        public string OldPassword { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "NewPasswordEmpty")]
        //[StringLength(40, ErrorMessage = "Password needs at least {2} characters", MinimumLength = 6)]
        [RegularExpression(@".{6,999}", ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "ValidPassword")]
        [DataType(DataType.Password)]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Compare("NewPassword", ErrorMessageResourceType = typeof(Resources.Resource), ErrorMessageResourceName = "PasswordNotMatch")]
        public string ConfirmPassword { get; set; }

        public string ReturnUrl { get; set; }
    }
}